ResultImpl() { try { DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false); // safe - only used for BI s2d = new SAX2DOMEx(factory); } catch (ParserConfigurationException e) { throw new AssertionError(e); // impossible } XMLFilterImpl f = new XMLFilterImpl() { @Override public void setDocumentLocator(Locator locator) { super.setDocumentLocator(locator); location = new LocatorImpl(locator); } }; f.setContentHandler(s2d); setHandler(f); }
/** * Obtains a {@link JType} object for the string representation * of a type. */ public static JType getType( JCodeModel codeModel, String typeName, ErrorReceiver errorHandler, Locator errorSource ) { try { return codeModel.parseType(typeName); } catch( ClassNotFoundException ee ) { // make it a warning errorHandler.warning( new SAXParseException( Messages.ERR_CLASS_NOT_FOUND.format(typeName) ,errorSource)); // recover by assuming that it's a class that derives from Object return codeModel.directClass(typeName); } }
protected CPropertyInfo(String name, boolean collection, XSComponent source, CCustomizations customizations, Locator locator) { this.publicName = name; String n = null; Model m = Ring.get(Model.class); if (m != null) { n = m.getNameConverter().toVariableName(name); } else { 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 QName translateQualifiedName(Locator locator, String s) { if (s == null) return null; String prefix = XmlUtil.getPrefix(s); String uri = null; if (prefix == null) { uri = getDefaultNamespaceURI(); } else { uri = getNamespaceURI(prefix); if (uri == null) { errorReceiver.error(locator, WsdlMessages.PARSING_UNKNOWN_NAMESPACE_PREFIX(prefix)); } } return new QName(uri, XmlUtil.getLocalPart(s)); }
ElementPattern(NameClass nameClass, Pattern p, Locator loc) { super(false, ELEMENT_CONTENT_TYPE, combineHashCode(ELEMENT_HASH_CODE, nameClass.hashCode(), p.hashCode())); this.nameClass = nameClass; this.origNameClass = nameClass; this.p = p; this.loc = loc; }
/** * Sets the document locator associated with our parser. * * @param locator * The new locator */ @Override public void setDocumentLocator(Locator locator) { if (saxLog.isDebugEnabled()) { saxLog.debug("setDocumentLocator(" + locator + ")"); } this.locator = locator; }
/** * Adapter implementation method; do not call. * Adapt a SAX1 document locator event. * * @param locator A document locator. * @see org.xml.sax.ContentHandler#setDocumentLocator */ public void setDocumentLocator (Locator locator) { this.locator = locator; if (contentHandler != null) { contentHandler.setDocumentLocator(locator); } }
public ModelGroupDeclImpl( SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, String _targetNamespace, String _name, ModelGroupImpl _modelGroup ) { super(owner,_annon,_loc,_fa,_targetNamespace,_name,false); this.modelGroup = _modelGroup; if(modelGroup==null) throw new IllegalArgumentException(); }
public CElementPropertyInfo(String name, CollectionMode collection, ID id, MimeType expectedMimeType, XSComponent source, CCustomizations customizations, Locator locator, boolean required) { super(name, collection.col, source, customizations, locator); this.required = required; this.id = id; this.expectedMimeType = expectedMimeType; this.isValueList = collection.val; }
public ModelGroupImpl( SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, Compositor _compositor, ParticleImpl[] _children ) { super(owner,_annon,_loc,_fa); this.compositor = _compositor; this.children = _children; if(compositor==null) throw new IllegalArgumentException(); for( int i=children.length-1; i>=0; i-- ) if(children[i]==null) throw new IllegalArgumentException(); }
public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno) throws BuildException { try { return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc); } catch (DatatypeException e) { String detail = e.getMessage(); if (detail != null) { error("invalid_params_detail", detail, (Locator) loc); } else { error("invalid_params", (Locator) loc); } return pb.makeError(); } }
/** * Write setDocumentLocator tag when meet setDocumentLocator event. */ @Override public void setDocumentLocator(Locator locator) { try { this.locator = locator; println("setDocumentLocator..."); } catch (SAXException ex) { System.err.println(WRITE_ERROR + ex); } }
/** * @param name */ public CEnumConstant(String name, String javadoc, String lexical, XSComponent source, CCustomizations customizations, Locator loc) { assert name!=null; this.name = name; this.javadoc = javadoc; this.lexical = lexical; this.source = source; this.customizations = customizations; this.locator = loc; }
public Definitions(AbstractDocument document, Locator locator) { super(locator); _document = document; _bindings = new ArrayList(); _imports = new ArrayList(); _messages = new ArrayList(); _portTypes = new ArrayList(); _services = new ArrayList(); _importedNamespaces = new HashSet(); _helper = new ExtensibilityHelper(); }
public AttributeDeclImpl( SchemaDocumentImpl owner, String _targetNamespace, String _name, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, boolean _anonymous, XmlString _defValue, XmlString _fixedValue, Ref.SimpleType _type ) { super(owner,_annon,_loc,_fa,_targetNamespace,_name,_anonymous); if(_name==null) // assertion failed. throw new IllegalArgumentException(); this.defaultValue = _defValue; this.fixedValue = _fixedValue; this.type = _type; }
public Locator getLocator() { return locator; }
/** * Gets the source location where this element is declared. */ public Locator getLocation() { return DOMLocator.getLocationInfo(e); }
public SimpleType_Union(NGCCRuntimeEx runtime, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) { this(null, runtime, runtime, -1, _annotation, _locator, _fa, _name, _finalSet); }
public Locator getLocator(){ return entity.getLocator(); }
public void setDocumentLocator(Locator locator) { fSAXLocatorWrapper.setLocator(locator); }
public void setDocumentLocator(Locator locator) { this.locator = locator; }
void warning( Locator loc, String prop, Object... args ) { errorReceiver.warning( new SAXParseException( Messages.format(prop,args), loc )); }
public CPluginCustomization(Element element, Locator locator) { this.element = element; this.locator = locator; }
public void setDocumentLocator(Locator locator) { }
Locator getLocator() { return loc; }
private void error(String key, Locator loc) throws BuildException { error(new SAXParseException(localizer.message(key), loc)); }
public GlobalEntity(Defining defining, Locator locator, ErrorReceiver errorReceiver) { super(locator); _defining = defining; this.errorReceiver = errorReceiver; }
private void warn(Locator location) { errReceiver.warning(location, ModelerMessages.WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED( AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME)); }
public CClassInfo(Model model,JPackage pkg, String shortName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations) { this(model,model.getPackage(pkg),shortName,location,typeName,elementName,source,customizations); }
public String getPublicId() { Locator l = findLocator(); if(l!=null) return l.getPublicId(); return null; }
/** * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator) */ public void setDocumentLocator(Locator arg0) { super.setDocumentLocator(arg0); m_saxHandler.setDocumentLocator(arg0); }
public JDefinedClass createClass( JClassContainer parent, int mod, String name, Locator source ) { return createClass(parent,mod,name,source,ClassType.CLASS); }
public wildcardBody(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, Locator _locator) { super(source, parent, cookie); $runtime = runtime; this.locator = _locator; $_ngcc_current_state = 10; }
public ParsedPattern makeAttribute(ParsedNameClass nc, ParsedPattern p, Location loc, Annotations anno) throws BuildException { return pb.makeAttribute((NameClass) nc, (Pattern) p, (Locator) loc); }
@Override public void setDocumentLocator(Locator locator) { super.setDocumentLocator(locator); this.loc = locator; }
public Locator getEndLocation( Element e ) { return (Locator)endLocations.get(e); }
private void warning(String key, String arg, Locator loc) throws SAXException { warning(new SAXParseException(localizer.message(key, arg), loc)); }