Java Code Examples for com.sun.xml.xsom.XSFacet#getValue()

The following examples show how to use com.sun.xml.xsom.XSFacet#getValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleTypeAnalyzer.java    From hyperjaxb3 with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public Long getValue(XSFacet facet) {
	final XmlString value = facet.getValue();

	if (value == null) {
		return null;
	} else {
		final String v = value.value;

		if (v == null) {
			return null;
		} else {
			final BigInteger integerValue = DatatypeConverter.parseInteger(v);
			if (integerValue.compareTo(BigInteger
					.valueOf(Long.MAX_VALUE)) > 0) {
				return Long.MAX_VALUE;
			} else {
				return integerValue.longValue();
			}
		}
	}
}
 
Example 2
Source File: CollectEnumerationValuesVisitor.java    From jsonix-schema-compiler with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void restrictionSimpleType(XSRestrictionSimpleType type) {
	final List<XSFacet> facets = type.getFacets(XSFacet.FACET_ENUMERATION);
	if (facets != null) {
		for (XSFacet facet : facets) {
			final XmlString value = facet.getValue();
			if (value != null) {
				this.values.add(value);
			}
		}
	}
}