Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*     */ package com.sun.xml.bind.v2.runtime.property;
 /*     */ 
 /*     */ import com.sun.xml.bind.api.AccessorException;
 /*     */ import com.sun.xml.bind.v2.runtime.Name;
 /*     */ import com.sun.xml.bind.v2.runtime.NameBuilder;
/*     */ import com.sun.xml.bind.v2.util.QNameMap;
/*     */ import java.io.IOException;
/*     */ import javax.xml.stream.XMLStreamException;
/*     */ import org.xml.sax.SAXException;
/*     */ 
/*     */ public final class AttributeProperty<BeanT> extends PropertyImpl<BeanT>
/*     */   implements Comparable<AttributeProperty>
/*     */ {
/*     */   public final Name attName;
/*     */   public final TransducedAccessor<BeanT> xacc;
/*     */   private final Accessor acc;
/*     */ 
/*     */   public AttributeProperty(JAXBContextImpl contextRuntimeAttributePropertyInfo prop)
/*     */   {
/*  85 */     super(context, prop);
/*  86 */     this.attName = context.nameBuilder.createAttributeName(prop.getXmlName());
/*  87 */     this.xacc = TransducedAccessor.get(context, prop);
/*  88 */     this.acc = prop.getAccessor();
/*     */   }
/*     */ 
/*     */   public void serializeAttributes(BeanT oXMLSerializer w)
/*     */     throws SAXExceptionAccessorExceptionIOExceptionXMLStreamException
/*     */   {
/*  97 */     CharSequence value = this.xacc.print(o);
/*  98 */     if (value != null)
/*  99 */       w.attribute(this.attName, value.toString());
/*     */   }
/*     */ 
/*     */   public void serializeURIs(BeanT oXMLSerializer wthrows AccessorExceptionSAXException {
/* 103 */     this.xacc.declareNamespace(o, w);
/*     */   }
/*     */ 
/*     */   public boolean hasSerializeURIAction() {
/* 107 */     return this.xacc.useNamespace();
/*     */   }
/*     */ 
/*     */   public void buildChildElementUnmarshallers(UnmarshallerChain chainElemQNameMap<ChildLoaderhandlers) {
/* 111 */     throw new IllegalStateException();
/*     */   }
/*     */ 
/*     */   public PropertyKind getKind()
/*     */   {
/* 116 */     return PropertyKind.ATTRIBUTE;
/*     */   }
/*     */ 
/*     */   public void reset(BeanT othrows AccessorException {
/* 120 */     this.acc.set(o, null);
/*     */   }
/*     */ 
/*     */   public String getIdValue(BeanT beanthrows AccessorExceptionSAXException {
/* 124 */     return this.xacc.print(bean).toString();
/*     */   }
/*     */ 
/*     */   public int compareTo(AttributeProperty that) {
/* 128 */     return this.attName.compareTo(that.attName);
/*     */   }
/*     */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/thirdparty-all.jar
 * Qualified Name:     com.sun.xml.bind.v2.runtime.property.AttributeProperty
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X