本文整理汇总了Java中org.xml.sax.Locator类的典型用法代码示例。如果您正苦于以下问题:Java Locator类的具体用法?Java Locator怎么用?Java Locator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Locator类属于org.xml.sax包,在下文中一共展示了Locator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ResultImpl
import org.xml.sax.Locator; //导入依赖的package包/类
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);
}
示例2: getType
import org.xml.sax.Locator; //导入依赖的package包/类
/**
* 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);
}
}
示例3: CPropertyInfo
import org.xml.sax.Locator; //导入依赖的package包/类
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;
}
示例4: translateQualifiedName
import org.xml.sax.Locator; //导入依赖的package包/类
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));
}
示例5: ElementPattern
import org.xml.sax.Locator; //导入依赖的package包/类
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;
}
示例6: setDocumentLocator
import org.xml.sax.Locator; //导入依赖的package包/类
/**
* 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;
}
示例7: setDocumentLocator
import org.xml.sax.Locator; //导入依赖的package包/类
/**
* 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);
}
}
示例8: ModelGroupDeclImpl
import org.xml.sax.Locator; //导入依赖的package包/类
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();
}
示例9: CElementPropertyInfo
import org.xml.sax.Locator; //导入依赖的package包/类
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;
}
示例10: ModelGroupImpl
import org.xml.sax.Locator; //导入依赖的package包/类
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();
}
示例11: makePattern
import org.xml.sax.Locator; //导入依赖的package包/类
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();
}
}
示例12: setDocumentLocator
import org.xml.sax.Locator; //导入依赖的package包/类
/**
* 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);
}
}
示例13: CEnumConstant
import org.xml.sax.Locator; //导入依赖的package包/类
/**
* @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;
}
示例14: Definitions
import org.xml.sax.Locator; //导入依赖的package包/类
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();
}
示例15: AttributeDeclImpl
import org.xml.sax.Locator; //导入依赖的package包/类
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;
}