/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Encapsulates the default handling for leaf classes (which are bound
* to text in XML.) In particular this class knows how to convert
* the lexical value into the Java class according to this default rule.
*
* <p>
* This represents the spec-defined default handling for the Java
* type ({@link #getType()}.
*
* <p>
* For those Java classes (such as {@link String} or {@link Boolean})
* where the spec designates a specific default handling, there are
* constants in this class (such as {@link #STRING} or {@link #BOOLEAN}.)
*
* <p>
* The generated type-safe enum classes are also a leaf class,
* and as such there are {@link CEnumLeafInfo} that represents it
* as {@link CBuiltinLeafInfo}.
*
* <p>
* This class represents the <b>default handling</b>, and therefore
* we can only have one instance per one {@link NType}. Handling of
* other XML Schema types (such as xs:token) are represented as
* a general {@link TypeUse} objects.
*
*
* @author Kohsuke Kawaguchi
*/
public abstract class CBuiltinLeafInfo extends BuiltinLeafInfoImpl<NType,NClass> implements CNonElement {
// no derived class other than the spec-defined ones. definitely not for enum.
}
/**
* Gets the code model representation of this type.
*/
}
/**
* Since {@link CBuiltinLeafInfo} represents a default binding,
* it is never a collection.
*/
public final boolean isCollection() {
return false;
}
/**
* Guaranteed to return this.
*/
return this;
}
return id;
}
/**
* {@link CBuiltinLeafInfo} never has a default associated MIME type.
*/
return null;
}
return null;
}
return Model.EMPTY_LOCATOR;
}
throw new UnsupportedOperationException("TODO. If you hit this, let us know.");
}
/**
* Creates a {@link TypeUse} that represents a collection of this {@link CBuiltinLeafInfo}.
*/
return TypeUseFactory.makeCollection(this);
}
/**
* Creates a {@link TypeUse} that represents an adapted use of this {@link CBuiltinLeafInfo}.
*/
}
/**
* Creates a {@link TypeUse} that represents a MIME-type assocaited version of this {@link CBuiltinLeafInfo}.
*/
}
/**
* {@link CBuiltinLeafInfo} for Java classes that have
* the spec defined built-in binding semantics.
*/
}
}
/**
* No vendor customization in the built-in classes.
*/
return CCustomizations.EMPTY;
}
}
super(c, typeName);
}
return null;
}
}
/**
* All built-in leaves.
*/
}
};
}
};
}
};
}
};
}
};
}
};
}
};
}
};
}
};
// XMLGregorianCalendar is mutable, so we can't support default values anyhow.
// For CALENAR we are uses a most unlikely name so as to avoid potential name
// conflicts in the furture.
public static final CBuiltinLeafInfo CALENDAR = new NoConstantBuiltin(XMLGregorianCalendar.class,"\u0000");
}
};
}
};
return outline.getCodeModel().ref(DatatypeConverter.class).staticInvoke("parseBase64Binary").arg(lexical.value);
}
};
public static final CBuiltinLeafInfo DATA_HANDLER = new NoConstantBuiltin(DataHandler.class,"base64Binary");
public static final CBuiltinLeafInfo XML_SOURCE = new NoConstantBuiltin(Source.class,"base64Binary");
// TODO: not sure if they should belong here,
// but I couldn't find other places that fit.
public static final TypeUse ID = TypeUseFactory.makeID(TOKEN,com.sun.xml.internal.bind.v2.model.core.ID.ID);
/**
* boolean restricted to 0 or 1.
*/
/**
* IDREF.
*
* IDREF is has a whitespace normalization semantics of token, but
* we don't want {@link XmlJavaTypeAdapter} and {@link XmlIDREF} to interact.
*/
public static final TypeUse IDREF = TypeUseFactory.makeID(ANYTYPE,com.sun.xml.internal.bind.v2.model.core.ID.IDREF);
/**
* For all list of strings, such as NMTOKENS, ENTITIES.
*/
}