/** * Computes a Java identifier from a local name. * * <p> * This method faithfully implements the name mangling rule as specified in the JAXB spec. * * <p> * In JAXB, a collision with a Java reserved word (such as "return") never happens. * Accordingly, this method may return an identifier that collides with reserved words. * * <p> * Use {@code JJavaName.isJavaIdentifier(String)} to check for such collision. * * @return * Typically, this method returns "nameLikeThis". */ public static @NotNull String mangleNameToVariableName(@NotNull String localName) { return NameConverter.standard.toVariableName(localName); }
private QName calcXmlName(XmlAttribute att) { String uri; String local; uri = att.namespace(); local = att.name(); // compute the default if(local.equals("##default")) local = NameConverter.standard.toVariableName(getName()); if(uri.equals("##default")) { XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this ); // JAX-RPC doesn't want the default namespace URI swapping to take effect to // local "unqualified" elements. UGLY. if(xs!=null) { switch(xs.attributeFormDefault()) { case QUALIFIED: uri = parent.getTypeName().getNamespaceURI(); if(uri.length()==0) uri = parent.builder.defaultNsUri; break; case UNQUALIFIED: case UNSET: uri = ""; } } else uri = ""; } return new QName(uri.intern(),local.intern()); }
local = NameConverter.standard.toVariableName(nav().getClassShortName(clazz));
/** * Parses an {@link XmlRootElement} annotation on a class * and determine the element name. * * @return null * if none was found. */ protected final QName parseElementName(ClassDeclT clazz) { XmlRootElement e = reader().getClassAnnotation(XmlRootElement.class,clazz,this); if(e==null) return null; String local = e.name(); if(local.equals("##default")) { // if defaulted... local = NameConverter.standard.toVariableName(nav().getClassShortName(clazz)); } String nsUri = e.namespace(); if(nsUri.equals("##default")) { // if defaulted ... XmlSchema xs = reader().getPackageAnnotation(XmlSchema.class,clazz,this); if(xs!=null) nsUri = xs.namespace(); else { nsUri = builder.defaultNsUri; } } return new QName(nsUri.intern(),local.intern()); }
/** * Computes a Java identifier from a local name. * * <p> * This method faithfully implements the name mangling rule as specified in the JAXB spec. * * <p> * In JAXB, a collision with a Java reserved word (such as "return") never happens. * Accordingly, this method may return an identifier that collides with reserved words. * * <p> * Use {@code JJavaName.isJavaIdentifier(String)} to check for such collision. * * @return * Typically, this method returns "nameLikeThis". */ public static @NotNull String mangleNameToVariableName(@NotNull String localName) { return NameConverter.standard.toVariableName(localName); }
private QName calcXmlName(XmlAttribute att) { String uri; String local; uri = att.namespace(); local = att.name(); // compute the default if(local.equals("##default")) local = NameConverter.standard.toVariableName(getName()); if(uri.equals("##default")) { XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this ); // JAX-RPC doesn't want the default namespace URI swapping to take effect to // local "unqualified" elements. UGLY. if(xs!=null) { switch(xs.attributeFormDefault()) { case QUALIFIED: uri = parent.getTypeName().getNamespaceURI(); if(uri.length()==0) uri = parent.builder.defaultNsUri; break; case UNQUALIFIED: case UNSET: uri = ""; } } else uri = ""; } return new QName(uri.intern(),local.intern()); }
local = NameConverter.standard.toVariableName(nav().getClassShortName(clazz));
/** * Parses an {@link XmlRootElement} annotation on a class * and determine the element name. * * @return null * if none was found. */ protected final QName parseElementName(ClassDeclT clazz) { XmlRootElement e = reader().getClassAnnotation(XmlRootElement.class,clazz,this); if(e==null) return null; String local = e.name(); if(local.equals("##default")) { // if defaulted... local = NameConverter.standard.toVariableName(nav().getClassShortName(clazz)); } String nsUri = e.namespace(); if(nsUri.equals("##default")) { // if defaulted ... XmlSchema xs = reader().getPackageAnnotation(XmlSchema.class,clazz,this); if(xs!=null) nsUri = xs.namespace(); else { nsUri = builder.defaultNsUri; } } return new QName(nsUri.intern(),local.intern()); }
public boolean matches(final String arg) { return arg.startsWith("-") && (this.name.equalsIgnoreCase(arg.substring(1)) || this.name.equals(Option.NAME_CONVERTER.toVariableName(arg.substring(1))) ); }
public boolean tryParse(final String arg) { final int equalsIndex = arg.indexOf("="); if(arg.startsWith("-") && equalsIndex > 0 && (this.name.equalsIgnoreCase(arg.substring(1, equalsIndex)) || this.name.equals(Option.NAME_CONVERTER.toVariableName(arg.substring(1, equalsIndex))) )) { setStringValue(arg.substring(equalsIndex+1)); return true; } else { return false; } } }
protected CPropertyInfo(String name, boolean collection, XSComponent source, CCustomizations customizations, Locator locator) { this.publicName = name; String n = NameConverter.standard.toVariableName(name); if(!JJavaName.isJavaIdentifier(n)) n = '_'+n; // avoid colliding with the reserved names like 'abstract'. this.privateName = n; this.isCollection = collection; this.locator = locator; if(customizations==null) this.customizations = CCustomizations.EMPTY; else this.customizations = customizations; this.source = source; }
protected CPropertyInfo(String name, boolean collection, XSComponent source, CCustomizations customizations, Locator locator) { this.publicName = name; String n = NameConverter.standard.toVariableName(name); if(!JJavaName.isJavaIdentifier(n)) n = '_'+n; // avoid colliding with the reserved names like 'abstract'. this.privateName = n; this.isCollection = collection; this.locator = locator; if(customizations==null) this.customizations = CCustomizations.EMPTY; else this.customizations = customizations; this.source = source; }
public static String getPropertyName(FieldOutline fieldOutline) { return NameConverter.standard.toVariableName(fieldOutline .getPropertyInfo().getName(true)); }
public String getPropertyName(Mapping context, FieldOutline fieldOutline) { return NameConverter.standard.toVariableName(fieldOutline .getPropertyInfo().getName(true)); }
public String getPropertyName(Mapping context, FieldOutline fieldOutline) { return NameConverter.standard.toVariableName(fieldOutline .getPropertyInfo().getName(true)); }
public static String getPropertyName(FieldOutline fieldOutline) { return NameConverter.standard.toVariableName(fieldOutline .getPropertyInfo().getName(true)); }
public static String getPropertyName(FieldOutline fieldOutline) { return NameConverter.standard.toVariableName(fieldOutline .getPropertyInfo().getName(true)); }
/** * Computes a Java identifier from a local name. * * <p> * This method faithfully implements the name mangling rule as specified in the JAXB spec. * * <p> * In JAXB, a collision with a Java reserved word (such as "return") never happens. * Accordingly, this method may return an identifier that collides with reserved words. * * <p> * Use {@code JJavaName.isJavaIdentifier(String)} to check for such collision. * * @return * Typically, this method returns "nameLikeThis". */ public static @NotNull String mangleNameToVariableName(@NotNull String localName) { return NameConverter.standard.toVariableName(localName); }
/** * Computes a Java identifier from a local name. * * <p> * This method faithfully implements the name mangling rule as specified in the JAXB spec. * * <p> * In JAXB, a collision with a Java reserved word (such as "return") never happens. * Accordingly, this method may return an identifier that collides with reserved words. * * <p> * Use {@code JJavaName.isJavaIdentifier(String)} to check for such collision. * * @return * Typically, this method returns "nameLikeThis". */ public static @NotNull String mangleNameToVariableName(@NotNull String localName) { return NameConverter.standard.toVariableName(localName); }
/** * Computes a Java identifier from a local name. * * <p> * This method faithfully implements the name mangling rule as specified in the JAXB spec. * * <p> * In JAXB, a collision with a Java reserved word (such as "return") never happens. * Accordingly, this method may return an identifier that collides with reserved words. * * <p> * Use <tt>JJavaName.isJavaIdentifier(String)</tt> to check for such collision. * * @return * Typically, this method returns "nameLikeThis". */ public static @NotNull String mangleNameToVariableName(@NotNull String localName) { return NameConverter.standard.toVariableName(localName); }